<%--
  - Author		:	Jaewon Choi
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});
		</script>
	</head>
	<body>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="menuTitle">
					콘텐츠 상세보기
				</div>
				<form id="frm" name="frm" method="post" action="<c:url value="/content/form.do" />">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="startDate" value="${param.startDate}" /> 
					<input type="hidden" name="endDate" value="${param.endDate}" />
					<input type="hidden" name="searchName" value="${param.searchName}" />
					<input type="hidden" name="searchCategoryId" value="${param.searchCategoryId}" />
					
					<table class="frmTbl" border="0">
						<colgroup>
							<col width="176px;" />
							<col width="280px" />
							<col width="*" />
							<col width="*" />
						</colgroup>
						<tbody>
			 				<tr>
								<th>콘텐츠 IDX</th>
								<td colspan="3">
									${content.idx}
									<input type="hidden" name="idx" value="${content.idx}">
								</td>
							</tr>
							<tr>
								<th>콘텐츠명 *</th>
								<td>
									${content.name}
								</td>
								<th>발행일 *</th>
								<td>
									${content.issueYear}-${content.issueMonth}-${content.issueDay}
								</td>
							</tr>
							<tr>
								<th>발행호 *</th>
								<td>
									${content.issueNo}
								</td>
								<th>발행주</th>
								<td>
									${content.issueWeek}
								</td>
							</tr>
							<tr>
								<th>콘텐츠 설명 *</th>
								<td colspan="3">
									<textarea name="contDesc" style="border: none; height: 150px; width: 620px;" onfocus="javascript:this.blur();">${content.contDesc}</textarea>
								</td>
							</tr>
							<tr>
								<th>메인 노출</th>
								<td colspan="3">
									<c:forEach items="${categoryList}" var="category">
										<c:if test="${category.idx eq 1}">
											<label>
												<input type="checkbox" name="categoryIdx" value="${category.idx}" disabled="disabled" <c:if test="${not empty content.idx && category.contentIdx eq content.idx}">checked="checked"</c:if>>
												${category.name}
											</label>
										</c:if>
									</c:forEach>
								</td>
							</tr>
							<tr>
								<th>브랜드 *</th>
								<td colspan="3">
									<c:forEach items="${categoryList}" var="category">
										<c:if test="${category.idx ne 1}">
											<label>
												<input type="radio" name="categoryIdx" value="${category.idx}" disabled="disabled" <c:if test="${not empty content.idx && category.contentIdx eq content.idx}">checked="checked"</c:if>>
												${category.name}
											</label>
										</c:if>
									</c:forEach>
								</td>
							</tr>
							<tr>
								<th>콘텐츠 플래그</th>
								<td colspan="3">
									<label>
										<input type="radio" class="categoryIdx" name="conFlag" value="new" disabled="disabled" <c:if test="${(content.conFlag eq 'new')}">checked="checked"</c:if>>
										NEW
										<input type="radio" class="categoryIdx" name="conFlag" value="free" disabled="disabled" <c:if test="${(content.conFlag eq 'free')}">checked="checked"</c:if>>
										FREE
									</label>
								</td>
							</tr>
							<tr>
								<th>Android Price</th>
								<td colspan="3">
									<label>
										<c:choose>
											<c:when test="${content.androidPrice eq 0}">무료</c:when>
											<c:otherwise><fmt:formatNumber value="${content.androidPrice}" pattern='#,###' /></c:otherwise>
										</c:choose>
									</label>
								</td>
							</tr>
							<tr>
								<th>Android SKU ID</th>
								<td colspan="3">
									<label>
										${content.skuId}
									</label>
								</td>
							</tr>
							<tr>
								<th>Android 유형</th>
								<td colspan="3">
									<label>
										${content.itemType}
									</label>
								</td>
							</tr>
							<tr>
								<th>iOS Price</th>
								<td colspan="3">
									<label>
										<c:choose>
											<c:when test="${content.iosPrice eq 0}">무료</c:when>
											<c:otherwise>${content.iosPrice}</c:otherwise>
										</c:choose>
									</label>
								</td>
							</tr>
							<tr>
								<th>iOS STORE KIT</th>
								<td colspan="3">
									<label>
										${content.storeKit}
									</label>
								</td>
							</tr>
							<tr>
								<th>콘텐츠 파일 *</th>
								<td colspan="3" style="overflow: hidden;">
									<input type="text" value="${contFile[0].fileUrl}" style="width: 600px;">
								</td>
							</tr>
							<tr>
								<th>MSLS 파일 *</th>
								<td colspan="3" style="overflow: hidden;">
									<input type="text" value="${mslsFile[0].fileUrl}" style="width: 600px;">
								</td>
							</tr>
							<tr>
								<th>커버 이미지 *</th>
								<td colspan="3">
									<img src="${coverImg[0].fileUrl}" class="thumbnailImg" />
								</td>
							</tr>
							<tr>
								<th>메인 이미지(리스트형)</th>
								<td colspan="3">
									<c:if test="${not empty listTypeMainImg[0].fileUrl}">
										<img src="${listTypeMainImg[0].fileUrl}" class="thumbnailImg" />
									</c:if>
								</td>
							</tr>
							<tr>
								<th rowspan="${fn:length(mainImgs)+1}">메인 이미지(앨범형)</th>
								<th>이미지 파일</th>
								<th>엠블럼</th>
								<th>이동 페이지</th>
							</tr>
							<c:forEach var="mainImg" items="${mainImgs}" varStatus="stat">
								<tr>
									<td>
										<img src="${mainImg.fileUrl}" class="thumbnailImg" />
									</td>
									<td>
										<c:set var="emblem" value="${fn:split(fn:replace(mainImg.fileData, '^^','^-^'), '^')[3]}" />
										<c:choose>
											<c:when test="${emblem eq 'N'}">NEW</c:when>
											<c:when test="${emblem eq 'E'}">EVENT</c:when>
											<c:when test="${emblem eq 'S'}">SPECIAL</c:when>
											<c:when test="${emblem eq 'H'}">HOT</c:when>
											<c:when test="${emblem eq 'X'}">없음</c:when>
											<c:otherwise>${emblem}</c:otherwise>
										</c:choose>
									</td>
									<td>
										${fn:split(fn:replace(mainImg.fileData, '^^','^-^'), '^')[2]}
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<input type="button" class="btn" value="목록" onclick="javascript:document.listFrm.submit();" />
					<input type="submit" class="btn" value="수정" />
				</form>
				<form name="listFrm" action="<c:url value="/content/list.do" />" method="post" style="display: none;">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="startDate" value="${param.startDate}" /> 
					<input type="hidden" name="endDate" value="${param.endDate}" />
					<input type="hidden" name="name" value="${param.searchName}" />
					<input type="hidden" name="categoryId" value="${param.searchCategoryId}" />
				</form>
			</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
		</div>
	</body>
</html> 